From c179013790ff0b62533547272e2881246e5df8e4 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Mon, 3 Jul 2023 20:51:51 +0200 Subject: [PATCH] testsuite: Add a test for mask out of bounds effects Inverted alpha masks have an effect on the source, even if the mask doesn't cover the source at all - or worse, is completely clipped out. The GL renderer handles this fine, but Cairo and Vulkan had optimizations that got this wrong. --- .../gsk/compare/mask-clipped-inverted-alpha.node | 14 ++++++++++++++ .../gsk/compare/mask-clipped-inverted-alpha.png | Bin 0 -> 129 bytes testsuite/gsk/meson.build | 1 + 3 files changed, 15 insertions(+) create mode 100644 testsuite/gsk/compare/mask-clipped-inverted-alpha.node create mode 100644 testsuite/gsk/compare/mask-clipped-inverted-alpha.png diff --git a/testsuite/gsk/compare/mask-clipped-inverted-alpha.node b/testsuite/gsk/compare/mask-clipped-inverted-alpha.node new file mode 100644 index 0000000000..c72328abe7 --- /dev/null +++ b/testsuite/gsk/compare/mask-clipped-inverted-alpha.node @@ -0,0 +1,14 @@ +clip { + clip: 0 0 40 40; + child: mask { + mode: inverted-alpha; + source: color { + bounds: 0 0 100 100; + color: rebeccapurple; + } + mask: color { + bounds: 40 40 60 60; + color: black; + } + } +} diff --git a/testsuite/gsk/compare/mask-clipped-inverted-alpha.png b/testsuite/gsk/compare/mask-clipped-inverted-alpha.png new file mode 100644 index 0000000000000000000000000000000000000000..2987324675ff85aae7951bebf88fbd35da93eaf7 GIT binary patch literal 129 zcmeAS@N?(olHy`uVBq!ia0vp^8X(NU1|)m_?Z^dE9-c0aArY-_&lxf{C@?TME)kmh zCMBx#KtVHKJ?Fb!*FX2k&yHvJ<670UYJt`Y+|(_VPfU%9uBUu~W-@rX`njxgN@xNA D(=sgQ literal 0 HcmV?d00001 diff --git a/testsuite/gsk/meson.build b/testsuite/gsk/meson.build index 9317e3a3e1..e48e9a3a45 100644 --- a/testsuite/gsk/meson.build +++ b/testsuite/gsk/meson.build @@ -65,6 +65,7 @@ compare_render_tests = [ 'invalid-transform', 'issue-3615', 'mask', + 'mask-clipped-inverted-alpha', 'mask-modes', 'mask-modes-with-alpha', 'nested-rounded-clips', -- 2.30.2